<extend name="Public/base" />

<block name="body">
    <div class="main-title" style="padding-bottom: 10px;">
        <h2>消耗品出库</h2>
    </div>
    <div class="row" ng-controller="SubproOutCtrl" ng-cloak class="ng-cloak">
        <form action="{:U('outadd')}" method='post' class="form-horizontal" ng-init='init()'>
            <div class="form-item">
                <div class="controls"></div>
            </div>
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-body" style="padding-bottom: 0px;padding-top: 0px;">
                        <div class="form-item cf">
                            <div class="controls">
                                <div style="border: #000 1px solid;margin-top: 5px;margin-bottom: 5px;" class='data-table table-striped '>
                                    <table  id="tbodyspec">
                                        <thead>
                                        <tr>
                                            <th scope="col" width="20%">商品名称</th>
                                            <th scope="col" width="20%">商品批次</th>
                                            <th style="padding-left: 50px">数量</th>
                                            <th scope="col">关联部门</th>
                                        </tr>
                                        </thead>
                                        <tbody id="tbodyspec_a">
                                        <tr >
                                            <td class="change">
                                                <select select2 style="height: 30px; width:200px;" ng-change="select(x)" ng-model="x">
                                                    <option value="">请选择...</option>
                                                    <option ng-repeat="p in product" value="{{($index)}}" >{{p.pname}}{{p.spec}}[{{p.unit}}]</option>
                                                </select>
                                            </td>
                                            <td >
                                                <select select2 style="height: 30px; width:220px;" ng-change="selectbatch(z)" ng-model="z">
                                                    <option value="">请选择...</option>
                                                    <option ng-repeat="b in batch" value="{{($index)}}" >{{b.batch}}[{{b.cnt}}剩余]</option>
                                                </select>
                                            </td>
                                            <td class="row" style="padding: 0">
                                                <div class="col-lg-3" style="padding: 0;margin: 0">
                                                    <div class="input-group ">
                                                        <input type="number" style="" class="form-control input-x" ng-change="cnt()" ng-model="sp.mother_unit_cnt" name="mother_unit_cnt" />
                                                        <span class="input-group-addon" ng-bind="sp.mother_unit"></span>
                                                    </div>
                                                </div>
                                                <span style="margin: 0" class="col-lg-1">或</span>
                                                <div class="col-lg-3" style="padding: 0;margin: 0">
                                                    <div class="input-group " >
                                                        <input type="number" style="" class="form-control input-x" ng-change="cnt()" ng-model="sp.son_unit_cnt" name="son_unit_cnt" />
                                                        <span class="input-group-addon" ng-bind="sp.son_unit"></span>
                                                    </div>
                                                </div>
                                                <input type="number" name="number" class="form-control input-small hide" ng-model="sp.number" />
                                            </td>
                                            <td>
                                                <input type="text" class="text input-small hide" name="spec" value="{{sp.spec}}" readonly/>
                                                <input type="text" class="text input-small hide" name="unit" value="{{sp.unit}}" readonly/>
                                                <input type="text" class="text input-small hide" name="pname" value="{{sp.pname}}" readonly/>
                                                <input type="text" class="text input-small hide" name="BIN" value="{{sp.BIN}}" readonly/>
                                                <input type="text" class="text input-small hide" name="batch" value="{{sp.batch}}" readonly/>
                                                <input class="form-control input-small"   name="toname" required/>
                                            </td>

                                        </tr>
                                        <!--读取商品信息-->
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-md-12">
                <button class="btn confirm btn-danger ajax-post" id="submit" type="submit" target-form="form-horizontal" autocomplete="off">出 库</button>
                <a  class="btn btn-primary" id="fh" onclick="javascript:history.back(-1); return false;">返 回</a>
            </div>
            <br><br>
        </form>


    </div>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Subpro/outlist')}');
    </script>
</block>
